package exception;

import java.io.FileNotFoundException;

public class ThrowDemo {
    public static void main(String[] args) throws IllegalAgeException {
        Student zs =new Student();

            zs.setAge(1000);//语法合理但明显不符合业务,报错后程序跳至catch语句块中,不报错则不执行catch语句块
            System.out.println("此人年龄为"+zs);

            System.out.println("年龄不合法");


    }
}
